const conf = new (require('conf'))()
const chalk = require('chalk')
const TaskAPI = require('../api/task')
const { get } = require('lodash')
async function del (index) {
    const taskAPI = new TaskAPI();
    const id = conf.get("task:" + index);
    if (id) {
        await taskAPI.delete(id)
        console.info(chalk.greenBright('deleted!'))
    } else {
        console.info(chalk.redBright('not found id', index))
    }

}
module.exports = {
    del
}
